From 4398e1246955546c76d7d690cb84b4fa3df03069 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 12 Oct 2015 16:11:11 +0200 Subject: [PATCH] GdkAppLaunchContext: Use the display name for X11 Using a NULL GAppInfo with g_app_launch_context_get_display() will generate a critical warning in gio. Use the display name instead as we don't have any valid GAppInfo to pass to g_app_launch_context_get_display(). bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=756439 --- gdk/x11/gdkapplaunchcontext-x11.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c index e82f578057..bb38e62c59 100644 --- a/gdk/x11/gdkapplaunchcontext-x11.c +++ b/gdk/x11/gdkapplaunchcontext-x11.c @@ -463,14 +463,13 @@ GdkAppLaunchContext * _gdk_x11_display_get_app_launch_context (GdkDisplay *display) { GdkAppLaunchContext *ctx; - static gchar *display_name; + const gchar *display_name; ctx = g_object_new (GDK_TYPE_X11_APP_LAUNCH_CONTEXT, "display", display, NULL); - display_name = g_app_launch_context_get_display (G_APP_LAUNCH_CONTEXT (ctx), - NULL, NULL); + display_name = gdk_display_get_name (display); if (display_name) g_app_launch_context_setenv (G_APP_LAUNCH_CONTEXT (ctx), "DISPLAY", display_name); -- 2.30.2